<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css" charset="utf-8" />

<title>Registration Page</title>
<script type="text/javascript"  language = "Javascript">

function FillFields(box) {
	if(box.checked == false) { return; }
	document.me.shipstreet.value  = document.me.street.value;
	document.me.shipcity.value  = document.me.city.value;
	document.me.shipstate.value  = document.me.state.value;
	document.me.shipcountry.value = document.me.country.value;
	document.me.shipzipcode.value  = document.me.zipcode.value;
	}

	function Validate(){
	var uname=document.me.username;
	var pass=document.me.password;
	var fname=document.me.firstname;
	var lname=document.me.lastname;
	var street=document.me.street;
	var city=document.me.city;
	var state=document.me.state;
	var country=document.me.country;
	var zipcode=document.me.zipcode;
	var card=document.me.card;
	var cardno=document.me.cardno;
	var expdate=document.me.expdate;
	
	if ((uname.value==null)||(uname.value=="")){
		alert("Please Enter user name");
		uname.focus();
		return false;
		}
	if ((pass.value==null)||(pass.value=="")){
		alert("Please Enter password");
		pass.focus();
		return false;
		}
	if ((fname.value==null)||(fname.value=="")){
		alert("Please Enter first name");
		fname.focus();
		return false;
	}
	if ((lname.value==null)||(lname.value=="")){
		alert("Please Enter last name");
		lname.focus();
		return false;
	}
	if ((street.value==null)||(street.value=="")){
		alert("Please Enter Street");
		uname.focus();
		return false;
		}
	if ((city.value==null)||(city.value=="")){
		alert("Please Enter City");
		pass.focus();
		return false;
		}
	if ((state.value==null)||(state.value=="")){
		alert("Please Enter State");
		state.focus();
		return false;
	}
	if ((country.value==null)||(country.value=="")){
		alert("Please Enter Country");
		fname.focus();
		return false;
	}
	if ((zipcode.value==null)||(zipcode.value=="")){
		alert("Please Enter Zip COde");
		lname.focus();
		return false;
	}
	if ((card.value==null)||(card.value=="")){
		alert("Please Enter Card Type V or M");
		pass.focus();
		return false;
		}
	if ((cardno.value==null)||(cardno.value=="")){
		alert("Please Enter Cardno");
		fname.focus();
		return false;
	}
	if ((expdate.value==null)||(expdate.value=="")){
		alert("Please Enter Exp date mm/yy");
		lname.focus();
		return false;
	}
	
	return true;
	}
</script>
</head>

<body> 
<form name="me" action="Registration " method=post onSubmit="return Validate()" >
<table cellpadding=4 cellspacing=10 border=0>

<tr><th><font size=5>REGISTRATION</font></th></tr>
<tr>
	<td valign=top><b>User Name<sup>*</sup></b> 
	<br><input type="text" name="username" value="" size=10 maxlength=10></td>
	<td valign=top><b>Password<sup>*</sup></b>
	<br><input type="password" name="password" value="" size=10 maxlength=10></td>
</tr>
<tr>
	<td valign=top><b>First Name<sup>*</sup></b> 
	<br><input type="text" name="firstname" value="" size=10 maxlength=20></td>
	<td valign=top><b>Last Name<sup>*</sup></b>
	<br><input type="text" name="lastname" value="" size=10 maxlength=20></td>
</tr>
<tr>
<td>BILLING ADDRESS</td>
</tr>
<tr >
	<td valign=top><b>Street<sup>*</sup></b> 
	<br><input type="text" name="street"  size=20 maxlength=20><br></td>
	<td valign=top><b>City<sup>*</sup></b> 
	<br><input type="text" name="city"  size=10 maxlength=10></td>
</tr>

<tr>
	<td valign=top><b>State<sup>*</sup></b>
	<br><input type="text" name="state" size=10  maxlength=20></td>
	<td valign=top><b>Country<sup>*</sup></b>
	<br><input type="text" name="country" size=10  maxlength=20></td>
</tr>
<tr>
<td valign=top><b>ZipCode<sup>*</sup></b>
	<br><input type="text" name="zipcode" size=10  maxlength=10></td>
</tr>
<tr>
<td>
<input type="checkbox" onclick="FillFields(this)">
        Check box to copy billing info into shipping.
<br>
</td>
</tr>
<tr>
<td>SHIPPING ADDRESS</td>
</tr>
<tr >
	<td valign=top><b>Street<sup>*</sup></b> 
	<br><input type="text" name="shipstreet"  size=20 maxlength=20><br></td>
	<td valign=top><b>City<sup>*</sup></b> 
	<br><input type="text" name="shipcity"  size=10 maxlength=10></td>
</tr>

<tr>
	<td valign=top><b>State<sup>*</sup></b>
	<br><input type="text" name="shipstate" size=10  maxlength=20></td>
	<td valign=top><b>Country<sup>*</sup></b>
	<br><input type="text" name="shipcountry" size=10 maxlength=20></td>
</tr>
<tr>
<td valign=top><b>ZipCode<sup>*</sup></b>
	<br><input type="text" name="shipzipcode" size=10 maxlength=10></td>
</tr>


<tr>
	<td valign=top><b>Card <sup>*</sup></b><br>
	<select name="card">
	<option value="V">Visa</option>
	<option value="M">Mastercard</option>
	</select></td>
	
	<td valign=top><b>Card No<sup>*</sup></b>
	<br><input type="password" name="cardno" size=16 value="" maxlength=16></td>
</tr>
<tr>
	<td valign=top><b>Expiration Date MM/YY<sup>*</sup></b>
	<br><input type="text" name="expdate" size=5 value="" maxlength=5></td>
</tr>
<tr>
	<td align=center colspan=2><hr>
	<input type="submit" value="Submit"></td>
</tr>
</table>
</form>
</body>
</html>
